import { isNumberType } from '@/utils/formMakeUtils.js';
import { aesDecode } from '@/utils/string';
/* 解密*/
export const decrypt = (val, element) => {
  if (element.type === 'upAttachment' || typeof val !== 'string' || !val) return val;
  let ans = aesDecode(val);
  if (isNumberType(element)) {
    ans = Number(ans);
  }
  return ans;
};
/**
 * 关联表单保存筛选条件
 * @param {*} presetFilter
 * @returns {string}
 */
export const linkFormPresetFilter = (presetFilter) => {
  return encodeURIComponent(JSON.stringify(presetFilter));
};
